xlat: Fix warning in CHECK_VIRT_ADDR_SPACE_SIZE
authorRoberto Vargas <[email protected]>
Wed, 9 May 2018 10:27:30 +0000 (11:27 +0100)
committerRoberto Vargas <[email protected]>
Wed, 9 May 2018 10:36:10 +0000 (11:36 +0100)
When TF is compiled for aarch32 MAX_VIRT_ADDR_SPACE_SIZE is 2^32 in some cases,
which makes the test (size) <= MAX_VIRT_ADDR_SPACE_SIZE a tautology because
uintptr_t is a 32 bit value. The cast remove the warning for clang.

Change-Id: I1345f3400f8fbbe4ffd3caa990a90e7ba593dba5
Signed-off-by: Roberto Vargas <[email protected]>
include/lib/xlat_tables/xlat_tables_arch.h

index 165b161d2393fac0e7bbdcbc49fc6e0ceb89ad26..af8c463318c8d75f55269563be98c8afb6039ac3 100644 (file)
@@ -21,8 +21,8 @@
  * limits. Not that these limits are different for AArch32 and AArch64.
  */
 #define CHECK_VIRT_ADDR_SPACE_SIZE(size)                       \
-       (((size) >= MIN_VIRT_ADDR_SPACE_SIZE) &&                \
-       ((size) <= MAX_VIRT_ADDR_SPACE_SIZE) &&                 \
+       (((unsigned long long)(size) >= MIN_VIRT_ADDR_SPACE_SIZE) &&            \
+       ((unsigned long long)(size) <= MAX_VIRT_ADDR_SPACE_SIZE) &&             \
        IS_POWER_OF_TWO(size))
 
 /*